<template>
	<view>
		<view class="page">
			<comp-common v-bind="{data:data}" @getUserInfo="getUserInfo" @myLogin="myLogin" @getPhoneNumber="getPhoneNumber" @hideGetCoupon="hideGetCoupon" @closeCouponBox="closeCouponBox" @navigatorClick="navigatorClick"></comp-common>
			<comp-header v-bind="{data:data}" @relevanceError="relevanceError" @relevanceSuccess="relevanceSuccess"></comp-header>
			<view class="body after-navber">
				<view style="padding: 150upx 95upx;text-align: center">
            <image :src="data.__wxapp_img.dapp.pc_login.url" style="width: 400upx;height: 300upx;margin-bottom: 100upx"></image>
            <view style="margin-bottom: 120upx;">即将登录网页端，是否允许登录？</view>
            <button @tap="loginSubmit" class="login-btn" style="margin-bottom: 56upx">允许登录</button>
            <navigator openType="redirect" style="display: inline-block;font-size: 9pt;color: #888" url="/pages/index/index">取消</navigator>
        </view>
			</view>
			<comp-footer v-bind="{data:data}"></comp-footer>
		</view>
	</view>
</template>

<script>var myVue = {};
	export default {
		data() {
			return {
				data: {},
			};
		},
		onLoad: function(e) {myVue = this;
        myVue.getApp.page.onLoad(this, e);
    },
    onReady: function(e) {
        myVue.getApp.page.onReady(this);
    },
    onShow: function(e) {
        myVue.getApp.page.onShow(this);
    },
    onHide: function(e) {
        myVue.getApp.page.onHide(this);
    },
    onUnload: function(e) {
        myVue.getApp.page.onUnload(this);
    },
		methods: {
			loginSubmit: function() {
        var e = this.options.scene || !1,_this = this;
        if ("undefined" != typeof my && null !== myVue.getApp.query) {
            var n = myVue.getApp.query;
            myVue.getApp.query = null, e = n.token;
        }
        if (!e) return myVue.getApp.core.showModal({
            title: "提示",
            content: "无效的Token，请刷新页面后重新扫码登录",
            showCancel: !1,
            success: function(e) {
                e.confirm && myVue.getApp.core.redirectTo({
                    url: "/pages/index/index"
                });
            }
        }), !1;
        myVue.getApp.core.showLoading({
            title: "正在处理",
            mask: !0
        }), myVue.getApp.request({
            url: myVue.getApp.api.user.web_login + "&token=" + e,
            success: function(e) {
                myVue.getApp.core.hideLoading(), myVue.getApp.core.showModal({
                    title: "提示",
                    content: e.msg,
                    showCancel: !1,
                    success: function(e) {
                        e.confirm && myVue.getApp.core.redirectTo({
                            url: "/pages/index/index"
                        });
                    }
                });
            }
        });
    }
		},
	}
</script>

<style scoped>
.login-btn {
    height: 88upx;
    line-height: 88upx;
    padding: 0 0;
    border: none;
    background: #ff4544;
    color: #fff;
    border-radius: 15upx;
    font-size: 11pt;
}
</style>
